import Vue from "vue";
import Router from "vue-router";
import RouterViewPage from "./views/RouterViewPage.vue"; 

import Welcome from "./views/Welcome";
import LoginPage from './LoginPage'
import Layout from './Layout/index'

import Err404 from './commons/error-page/404.vue';
 

Vue.use(Router);

var subRoutes = [
    {
        path: "/welcome",
        name: "首页",
        component: Welcome
    }  
]; 
  
export default new Router({
    routes: [
        {
            path: '/',
            redirect: "/login",
            component: RouterViewPage,
            children: [
                {
                    path: '/app',
                    redirect: "/welcome",
                    name: '首页',
                    component: Layout,
                    children: subRoutes
                },
                {
                    path: '/login',
                    name: '登录',
                    component: LoginPage,
                } 
            ]
        }, {
            path: "*",
            component: Err404
        }
    ]
})
